<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="my"  uri="http://www.trkj.com/tr1702/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>准考证</title>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link id="theme" rel="stylesheet" type="text/css"  href="<c:url value="js/jquery-easyui-1.5.4.2/themes/ui-cupertino/easyui.css"/>"/>
<link  rel="stylesheet" type="text/css" href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>"/>
<body>
<script type="text/javascript">

$(function(){
	$(".admission_insert").linkbutton({
		onClick:function(){
			$(".admission_").panel({
				href:"to_admission_insert"
				
			})
		}
	})
	
	$("#admission_clear").linkbutton({onClick:function(){
		//找到选中的行
		var row = $("#hhy_admission_findAll_datagrid").datagrid("getSelected");
		if(!row){
			$.messager.alert('提示', '没有选中要删除的行！');
			return;
		}
		
		$.messager.confirm('确认', '真的要删除吗？', function(v){
			$("<form method = 'post'>").appendTo(document.body).form({
				url:'admission_delete',
				onSubmit:function(params){
					params["admId"] =row.admId;
				},success:function(v){
					v = eval("(" + v + ")");
					if(v.success){
						
						$.messager.alert('恭喜', '删除成功');
						$('#hhy_admission_findAll_datagrid').datagrid('reload');
					}else{
						$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
					}
				}
			}).submit();

		});
	}});
	
	<my:g id="172">$("#hhy_admission_findAll_datagrid").datagrid({onDblClickRow:function(row){
		//找到选中的行
		var row = $("#hhy_admission_findAll_datagrid").datagrid("getSelected");
		if(!row){
			$.messager.alert('提示', '没有选中要编辑的行！');
			return;
		}
		$(".admission_").panel({
				href:"admission_update?admId="+row.admId
				
		})
	}

	});
	</my:g>
});

</script>
<style>
	.line{
		margin:10px 20px;
	}
</style>
<div class="easyui-panel admission_" data-options="fit:true,border:false">
	<table class="easyui-datagrid" id="hhy_admission_findAll_datagrid" style="text-align:center;width:100%;" data-options="
		method:'post',
		url:'to_admission_findAll',
		fitColumns:true,
		fit:true,
		nowrap:false,
		autoRowHeight:true,
		rownumbers:true,
		singleSelect:true,
		striped:true,
		pagination:true,
		pageList:[5,10,15,20],
		pageSize:5,
		toolbar:'#admission'
	">
		<thead>
			<tr>
				<th data-options="field:'admId',align:'center',width:20">准考证号</th>
				<th data-options="field:'stainName',align:'center',width:20">考生姓名</th>
				<th data-options="field:'admRemark',align:'center',width:30">备注</th>
				<th data-options="field:'admPerson',align:'center',width:20">创建者</th>
				<th data-options="field:'admDate',align:'center',width:50,formatter:function(value,row,index){
					var date= new Date(value);
					return date.toLocaleString();
				}">创建日期</th>
			</tr>
		</thead>
		<tbody>
			
		</tbody>
	</table>
	<div id="admission">
		<my:g id="170"><a href="#" class="easyui-linkbutton admission_insert" data-options="iconCls:'icon-add',plain:true,text:'添加'"></a></my:g>
		<my:g id="172"><a href="#" class="easyui-linkbutton" id="admission_clear" data-options="iconCls:'icon-clear',plain:true,text:'删除'"></a></my:g>
		激活  <select id="jihuo" class="easyui-combobox" data-options="width:100,panelHeight:'auto'">
				<option>是</option>
				<option>否</option>
			</select>
	
		搜索文本  <input id="admission_bir" class="easyui-textbox" data-options="width:100,placeholder:'编号，名称'">
		<a id="admission_btn" class="easyui-linkbutton" data-options="width:60,plain:false,text:'搜索'"></a> 
	</div>
</div>
</body>
</html>